/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package assisisw.smartcal.webuisubsystem.managedbean;

import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author Francesco
 */
@ManagedBean ( name = "userAnagraphicsBean" )
@ViewScoped ()
public class UserAnagraphicsViewDetailToggleBean implements Serializable
{

    // Static Fields
    
    /***/
    private static final String MORE_DETAILS_MESSAGE = "More info about you !" ;
    
    /***/
    private static final String LESS_DETAILS_MESSAGE = "Less info about you !" ;
    
    // Instance Fields
 
    /***/
    private Boolean detailViewEnabled ;
    
    // Instance Methods
    
    /***/
    public UserAnagraphicsViewDetailToggleBean () {}
    
    /***/
    @PostConstruct
    public void init ()
    {
        detailViewEnabled = false ;
    }
    
    /**
     * @return
     */
    public boolean isDetailViewEnabled () 
    {
        return detailViewEnabled ;
    }
    
    /***/
    public void toggleDetailViewEnabled () 
    {
        detailViewEnabled = !detailViewEnabled ;
    }
    
    /**
     * @return
     */
    public String getDetailsButtonString () 
    {
        String res ;
        res = detailViewEnabled ? LESS_DETAILS_MESSAGE : MORE_DETAILS_MESSAGE ;
        return res ;
    }
    
}
